package com.ly.honor.exception;

import com.ly.honor.util.ResultEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author LiYang
 * @Date 2022/11/17 17:09
 * @Version 1.0
 * 自定义异常处理类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HonorException extends RuntimeException{

    private Integer code;
    private String msg;

    public HonorException(ResultEnum resultEnum) {
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMsg();
    }

    public HonorException(String msg) {
        this.code = 20001;
        this.msg = msg;
    }

}
